<template>
  <div class="swiper">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item,index) in lunbo" :key='index'>
        <img :src="item.img" alt="">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { getSwiper } from '../../api/index'
export default {
  data () {
    return {
      lunbo: []
    }
  },
  created () {
    this.getLunbo()
  },
  methods: {
    async getLunbo () {
      const res = await getSwiper()
      if (res.status === 200) {
        this.lunbo = res.data.message
      }
      console.log(this.lunbo)
    }
  }
}
</script>

<style lang='less' scoped>
.swiper{
  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    height: 200px;
    width: 100%;
    background-color: #39a9ed;
    img{
      height: 100%;
      width: 100%;
    }
  }
}
</style>
